<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BadgerDB: /home/ubuntu/study/dbmslab/lab2/BufMgr/src/buffer.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">BadgerDB
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_43e0a1f539e00dcfa1a6bc4d4fee4fc2.html">home</a></li><li class="navelem"><a class="el" href="dir_f895279abf3c9abddbac24b9a320b4c6.html">ubuntu</a></li><li class="navelem"><a class="el" href="dir_9223221a80e1dde112a2f0d1c0d6bc8d.html">study</a></li><li class="navelem"><a class="el" href="dir_565d95caf30f979632cef261ad9a6ed4.html">dbmslab</a></li><li class="navelem"><a class="el" href="dir_04bc7b587b42191e49c8f970037360ad.html">lab2</a></li><li class="navelem"><a class="el" href="dir_ccc57109e70d5b9b219c75d9ecb5bc70.html">BufMgr</a></li><li class="navelem"><a class="el" href="dir_57419356550b183f8cb4d89f81ab51b6.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">buffer.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#pragma once</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160; </div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#include &quot;file.h&quot;</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#include &quot;bufHashTbl.h&quot;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160; </div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacebadgerdb.html">badgerdb</a> {</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160; </div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="keyword">class </span>BufMgr;</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="classbadgerdb_1_1_buf_desc.html">   23</a></span>&#160;<span class="keyword">class </span><a class="code" href="classbadgerdb_1_1_buf_desc.html">BufDesc</a> {</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160; </div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classbadgerdb_1_1_buf_mgr.html">BufMgr</a>;</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160; </div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160; <span class="keyword">private</span>:</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;  <a class="code" href="classbadgerdb_1_1_file.html">File</a>* file;</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;  <a class="code" href="namespacebadgerdb.html#a1f49e404293bf4240756b89b53b1587a">PageId</a> pageNo;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160; </div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;  <a class="code" href="namespacebadgerdb.html#a1e7378fbefaea050a47e6cde929e9c01">FrameId</a> frameNo;</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160; </div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;  <span class="keywordtype">int</span> pinCnt;</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160; </div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;  <span class="keywordtype">bool</span> dirty;</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160; </div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;  <span class="keywordtype">bool</span> valid;</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160; </div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;  <span class="keywordtype">bool</span> refbit;</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160; </div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;  <span class="keywordtype">void</span> Clear()</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;  {</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    pinCnt = 0;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    file = NULL;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    pageNo = <a class="code" href="classbadgerdb_1_1_page.html#a785a1e756d47fb7f8f3603a3fe8ffcef">Page::INVALID_NUMBER</a>;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    dirty = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    refbit = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    valid = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;  };</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160; </div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;  <span class="keywordtype">void</span> Set(<a class="code" href="classbadgerdb_1_1_file.html">File</a>* filePtr, <a class="code" href="namespacebadgerdb.html#a1f49e404293bf4240756b89b53b1587a">PageId</a> pageNum)</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;  { </div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    file = filePtr;</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    pageNo = pageNum;</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    pinCnt = 1;</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    dirty = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    valid = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    refbit = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;  }</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160; </div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;  <span class="keywordtype">void</span> Print()</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;  {</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    <span class="keywordflow">if</span>(file)</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    {</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;      std::cout &lt;&lt; <span class="stringliteral">&quot;file:&quot;</span> &lt;&lt; file-&gt;<a class="code" href="classbadgerdb_1_1_file.html#af16040a60f18c99305348077ac9e8aa8">filename</a>() &lt;&lt; <span class="stringliteral">&quot; &quot;</span>;</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;      std::cout &lt;&lt; <span class="stringliteral">&quot;pageNo:&quot;</span> &lt;&lt; pageNo &lt;&lt; <span class="stringliteral">&quot; &quot;</span>;</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    }</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    <span class="keywordflow">else</span></div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;      std::cout &lt;&lt; <span class="stringliteral">&quot;file:NULL &quot;</span>;</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160; </div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    std::cout &lt;&lt; <span class="stringliteral">&quot;valid:&quot;</span> &lt;&lt; valid &lt;&lt; <span class="stringliteral">&quot; &quot;</span>;</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    std::cout &lt;&lt; <span class="stringliteral">&quot;pinCnt:&quot;</span> &lt;&lt; pinCnt &lt;&lt; <span class="stringliteral">&quot; &quot;</span>;</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    std::cout &lt;&lt; <span class="stringliteral">&quot;dirty:&quot;</span> &lt;&lt; dirty &lt;&lt; <span class="stringliteral">&quot; &quot;</span>;</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    std::cout &lt;&lt; <span class="stringliteral">&quot;refbit:&quot;</span> &lt;&lt; refbit &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;  }</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160; </div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;  <a class="code" href="classbadgerdb_1_1_buf_desc.html">BufDesc</a>()</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;  {</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    Clear();</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;  }</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;};</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160; </div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160; </div>
<div class="line"><a name="l00122"></a><span class="lineno"><a class="line" href="structbadgerdb_1_1_buf_stats.html">  122</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structbadgerdb_1_1_buf_stats.html">BufStats</a></div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;{</div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="structbadgerdb_1_1_buf_stats.html#a3e7eb386ac728ed028bd2a8bb7960827">  127</a></span>&#160;  <span class="keywordtype">int</span> <a class="code" href="structbadgerdb_1_1_buf_stats.html#a3e7eb386ac728ed028bd2a8bb7960827">accesses</a>;</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160; </div>
<div class="line"><a name="l00132"></a><span class="lineno"><a class="line" href="structbadgerdb_1_1_buf_stats.html#a60cde025ce745b6bc41a0ba27daf04e0">  132</a></span>&#160;  <span class="keywordtype">int</span> <a class="code" href="structbadgerdb_1_1_buf_stats.html#a60cde025ce745b6bc41a0ba27daf04e0">diskreads</a>;</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160; </div>
<div class="line"><a name="l00137"></a><span class="lineno"><a class="line" href="structbadgerdb_1_1_buf_stats.html#a4bd2081fdaddaa309b401575eeb6a86e">  137</a></span>&#160;  <span class="keywordtype">int</span> <a class="code" href="structbadgerdb_1_1_buf_stats.html#a4bd2081fdaddaa309b401575eeb6a86e">diskwrites</a>;</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160; </div>
<div class="line"><a name="l00142"></a><span class="lineno"><a class="line" href="structbadgerdb_1_1_buf_stats.html#a04a848e5458491fd3ea56133464cadbd">  142</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="structbadgerdb_1_1_buf_stats.html#a04a848e5458491fd3ea56133464cadbd">clear</a>()</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;  {</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    <a class="code" href="structbadgerdb_1_1_buf_stats.html#a3e7eb386ac728ed028bd2a8bb7960827">accesses</a> = <a class="code" href="structbadgerdb_1_1_buf_stats.html#a60cde025ce745b6bc41a0ba27daf04e0">diskreads</a> = <a class="code" href="structbadgerdb_1_1_buf_stats.html#a4bd2081fdaddaa309b401575eeb6a86e">diskwrites</a> = 0;</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;  }</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;      </div>
<div class="line"><a name="l00150"></a><span class="lineno"><a class="line" href="structbadgerdb_1_1_buf_stats.html#ad9848260b3b787f15eb1b960b0f8e769">  150</a></span>&#160;  <a class="code" href="structbadgerdb_1_1_buf_stats.html#ad9848260b3b787f15eb1b960b0f8e769">BufStats</a>()</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;  {</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    <a class="code" href="structbadgerdb_1_1_buf_stats.html#a04a848e5458491fd3ea56133464cadbd">clear</a>();</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;  }</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;};</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160; </div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160; </div>
<div class="line"><a name="l00160"></a><span class="lineno"><a class="line" href="classbadgerdb_1_1_buf_mgr.html">  160</a></span>&#160;<span class="keyword">class </span><a class="code" href="classbadgerdb_1_1_buf_mgr.html">BufMgr</a> </div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;{</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160; <span class="keyword">private</span>:</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;  <a class="code" href="namespacebadgerdb.html#a1e7378fbefaea050a47e6cde929e9c01">FrameId</a> clockHand;</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160; </div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;  std::uint32_t numBufs;</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;  </div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;  <a class="code" href="classbadgerdb_1_1_buf_hash_tbl.html">BufHashTbl</a> *hashTable;</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160; </div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;  <a class="code" href="classbadgerdb_1_1_buf_desc.html">BufDesc</a> *bufDescTable;</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160; </div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;  <a class="code" href="structbadgerdb_1_1_buf_stats.html">BufStats</a> bufStats;</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160; </div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;  <span class="keywordtype">void</span> advanceClock();</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160; </div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;  <span class="keywordtype">void</span> allocBuf(<a class="code" href="namespacebadgerdb.html#a1e7378fbefaea050a47e6cde929e9c01">FrameId</a> &amp; frame);</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160; </div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00205"></a><span class="lineno"><a class="line" href="classbadgerdb_1_1_buf_mgr.html#aa498047fc351652d0bc7eabf6cb62ab0">  205</a></span>&#160;  <a class="code" href="classbadgerdb_1_1_page.html">Page</a>* <a class="code" href="classbadgerdb_1_1_buf_mgr.html#aa498047fc351652d0bc7eabf6cb62ab0">bufPool</a>;</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160; </div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;  <a class="code" href="classbadgerdb_1_1_buf_mgr.html#a18b7cf23b619c7c0e593d1dc45da77b4">BufMgr</a>(std::uint32_t bufs);</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;  </div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;  <a class="code" href="classbadgerdb_1_1_buf_mgr.html#aab08001e1be18bfbd4af9113e91cf953">~BufMgr</a>();</div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160; </div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classbadgerdb_1_1_buf_mgr.html#a9f853f0f1d4628e7e14374d0c7c6a4f3">readPage</a>(<a class="code" href="classbadgerdb_1_1_file.html">File</a>* file, <span class="keyword">const</span> <a class="code" href="namespacebadgerdb.html#a1f49e404293bf4240756b89b53b1587a">PageId</a> PageNo, <a class="code" href="classbadgerdb_1_1_page.html">Page</a>*&amp; page);</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160; </div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classbadgerdb_1_1_buf_mgr.html#aa9bdf04c8543f59744db22efa9420c89">unPinPage</a>(<a class="code" href="classbadgerdb_1_1_file.html">File</a>* file, <span class="keyword">const</span> <a class="code" href="namespacebadgerdb.html#a1f49e404293bf4240756b89b53b1587a">PageId</a> PageNo, <span class="keyword">const</span> <span class="keywordtype">bool</span> dirty);</div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160; </div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classbadgerdb_1_1_buf_mgr.html#ab9ae3b12aac55b119b5763e3de2a4d2b">allocPage</a>(<a class="code" href="classbadgerdb_1_1_file.html">File</a>* file, <a class="code" href="namespacebadgerdb.html#a1f49e404293bf4240756b89b53b1587a">PageId</a> &amp;PageNo, <a class="code" href="classbadgerdb_1_1_page.html">Page</a>*&amp; page); </div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160; </div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classbadgerdb_1_1_buf_mgr.html#acc61d1985720411ebb76e70f702827d3">flushFile</a>(<span class="keyword">const</span> <a class="code" href="classbadgerdb_1_1_file.html">File</a>* file);</div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160; </div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classbadgerdb_1_1_buf_mgr.html#a870a80a0f0abcf3b640b913b46b64486">disposePage</a>(<a class="code" href="classbadgerdb_1_1_file.html">File</a>* file, <span class="keyword">const</span> <a class="code" href="namespacebadgerdb.html#a1f49e404293bf4240756b89b53b1587a">PageId</a> PageNo);</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160; </div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;  <span class="keywordtype">void</span>  <a class="code" href="classbadgerdb_1_1_buf_mgr.html#a598b3112b8193af603f5bc97c478a671">printSelf</a>();</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160; </div>
<div class="line"><a name="l00276"></a><span class="lineno"><a class="line" href="classbadgerdb_1_1_buf_mgr.html#a93148e1af99f06f4f264d948920b7c1c">  276</a></span>&#160;  <a class="code" href="structbadgerdb_1_1_buf_stats.html">BufStats</a> &amp; <a class="code" href="classbadgerdb_1_1_buf_mgr.html#a93148e1af99f06f4f264d948920b7c1c">getBufStats</a>()</div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;  {</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;    <span class="keywordflow">return</span> bufStats;</div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;  }</div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160; </div>
<div class="line"><a name="l00284"></a><span class="lineno"><a class="line" href="classbadgerdb_1_1_buf_mgr.html#a702a264ae946b334414e51700edd81a0">  284</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="classbadgerdb_1_1_buf_mgr.html#a702a264ae946b334414e51700edd81a0">clearBufStats</a>() </div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;  {</div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;    bufStats.<a class="code" href="structbadgerdb_1_1_buf_stats.html#a04a848e5458491fd3ea56133464cadbd">clear</a>();</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;  }</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;};</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160; </div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html_aa498047fc351652d0bc7eabf6cb62ab0"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html#aa498047fc351652d0bc7eabf6cb62ab0">badgerdb::BufMgr::bufPool</a></div><div class="ttdeci">Page * bufPool</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8h_source.html#l00205">buffer.h:205</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_hash_tbl_html"><div class="ttname"><a href="classbadgerdb_1_1_buf_hash_tbl.html">badgerdb::BufHashTbl</a></div><div class="ttdoc">Hash table class to keep track of pages in the buffer pool.</div><div class="ttdef"><b>Definition:</b> <a href="buf_hash_tbl_8h_source.html#l00045">bufHashTbl.h:45</a></div></div>
<div class="ttc" id="anamespacebadgerdb_html"><div class="ttname"><a href="namespacebadgerdb.html">badgerdb</a></div><div class="ttdef"><b>Definition:</b> <a href="buffer_8cpp_source.html#l00017">buffer.cpp:17</a></div></div>
<div class="ttc" id="anamespacebadgerdb_html_a1e7378fbefaea050a47e6cde929e9c01"><div class="ttname"><a href="namespacebadgerdb.html#a1e7378fbefaea050a47e6cde929e9c01">badgerdb::FrameId</a></div><div class="ttdeci">std::uint32_t FrameId</div><div class="ttdoc">Identifier for a frame in buffer pool.</div><div class="ttdef"><b>Definition:</b> <a href="types_8h_source.html#l00025">types.h:25</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_page_html_a785a1e756d47fb7f8f3603a3fe8ffcef"><div class="ttname"><a href="classbadgerdb_1_1_page.html#a785a1e756d47fb7f8f3603a3fe8ffcef">badgerdb::Page::INVALID_NUMBER</a></div><div class="ttdeci">static const PageId INVALID_NUMBER</div><div class="ttdef"><b>Definition:</b> <a href="page_8h_source.html#l00123">page.h:123</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html_acc61d1985720411ebb76e70f702827d3"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html#acc61d1985720411ebb76e70f702827d3">badgerdb::BufMgr::flushFile</a></div><div class="ttdeci">void flushFile(const File *file)</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8cpp_source.html#l00146">buffer.cpp:146</a></div></div>
<div class="ttc" id="astructbadgerdb_1_1_buf_stats_html_a4bd2081fdaddaa309b401575eeb6a86e"><div class="ttname"><a href="structbadgerdb_1_1_buf_stats.html#a4bd2081fdaddaa309b401575eeb6a86e">badgerdb::BufStats::diskwrites</a></div><div class="ttdeci">int diskwrites</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8h_source.html#l00137">buffer.h:137</a></div></div>
<div class="ttc" id="astructbadgerdb_1_1_buf_stats_html_a3e7eb386ac728ed028bd2a8bb7960827"><div class="ttname"><a href="structbadgerdb_1_1_buf_stats.html#a3e7eb386ac728ed028bd2a8bb7960827">badgerdb::BufStats::accesses</a></div><div class="ttdeci">int accesses</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8h_source.html#l00127">buffer.h:127</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_desc_html"><div class="ttname"><a href="classbadgerdb_1_1_buf_desc.html">badgerdb::BufDesc</a></div><div class="ttdoc">Class for maintaining information about buffer pool frames.</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8h_source.html#l00023">buffer.h:23</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html_a870a80a0f0abcf3b640b913b46b64486"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html#a870a80a0f0abcf3b640b913b46b64486">badgerdb::BufMgr::disposePage</a></div><div class="ttdeci">void disposePage(File *file, const PageId PageNo)</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8cpp_source.html#l00179">buffer.cpp:179</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_file_html"><div class="ttname"><a href="classbadgerdb_1_1_file.html">badgerdb::File</a></div><div class="ttdoc">Class which represents a file in the filesystem containing database pages.</div><div class="ttdef"><b>Definition:</b> <a href="file_8h_source.html#l00073">file.h:73</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html_a18b7cf23b619c7c0e593d1dc45da77b4"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html#a18b7cf23b619c7c0e593d1dc45da77b4">badgerdb::BufMgr::BufMgr</a></div><div class="ttdeci">BufMgr(std::uint32_t bufs)</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8cpp_source.html#l00020">buffer.cpp:20</a></div></div>
<div class="ttc" id="anamespacebadgerdb_html_a1f49e404293bf4240756b89b53b1587a"><div class="ttname"><a href="namespacebadgerdb.html#a1f49e404293bf4240756b89b53b1587a">badgerdb::PageId</a></div><div class="ttdeci">std::uint32_t PageId</div><div class="ttdoc">Identifier for a page in a file.</div><div class="ttdef"><b>Definition:</b> <a href="types_8h_source.html#l00015">types.h:15</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html_aa9bdf04c8543f59744db22efa9420c89"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html#aa9bdf04c8543f59744db22efa9420c89">badgerdb::BufMgr::unPinPage</a></div><div class="ttdeci">void unPinPage(File *file, const PageId PageNo, const bool dirty)</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8cpp_source.html#l00129">buffer.cpp:129</a></div></div>
<div class="ttc" id="astructbadgerdb_1_1_buf_stats_html_a60cde025ce745b6bc41a0ba27daf04e0"><div class="ttname"><a href="structbadgerdb_1_1_buf_stats.html#a60cde025ce745b6bc41a0ba27daf04e0">badgerdb::BufStats::diskreads</a></div><div class="ttdeci">int diskreads</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8h_source.html#l00132">buffer.h:132</a></div></div>
<div class="ttc" id="astructbadgerdb_1_1_buf_stats_html_a04a848e5458491fd3ea56133464cadbd"><div class="ttname"><a href="structbadgerdb_1_1_buf_stats.html#a04a848e5458491fd3ea56133464cadbd">badgerdb::BufStats::clear</a></div><div class="ttdeci">void clear()</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8h_source.html#l00142">buffer.h:142</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html">badgerdb::BufMgr</a></div><div class="ttdoc">The central class which manages the buffer pool including frame allocation and deallocation to pages ...</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8h_source.html#l00160">buffer.h:160</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html_ab9ae3b12aac55b119b5763e3de2a4d2b"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html#ab9ae3b12aac55b119b5763e3de2a4d2b">badgerdb::BufMgr::allocPage</a></div><div class="ttdeci">void allocPage(File *file, PageId &amp;PageNo, Page *&amp;page)</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8cpp_source.html#l00168">buffer.cpp:168</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_page_html"><div class="ttname"><a href="classbadgerdb_1_1_page.html">badgerdb::Page</a></div><div class="ttdoc">Class which represents a fixed-size database page containing records.</div><div class="ttdef"><b>Definition:</b> <a href="page_8h_source.html#l00107">page.h:107</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_file_html_af16040a60f18c99305348077ac9e8aa8"><div class="ttname"><a href="classbadgerdb_1_1_file.html#af16040a60f18c99305348077ac9e8aa8">badgerdb::File::filename</a></div><div class="ttdeci">const std::string &amp; filename() const</div><div class="ttdef"><b>Definition:</b> <a href="file_8h_source.html#l00179">file.h:179</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html_aab08001e1be18bfbd4af9113e91cf953"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html#aab08001e1be18bfbd4af9113e91cf953">badgerdb::BufMgr::~BufMgr</a></div><div class="ttdeci">~BufMgr()</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8cpp_source.html#l00039">buffer.cpp:39</a></div></div>
<div class="ttc" id="astructbadgerdb_1_1_buf_stats_html_ad9848260b3b787f15eb1b960b0f8e769"><div class="ttname"><a href="structbadgerdb_1_1_buf_stats.html#ad9848260b3b787f15eb1b960b0f8e769">badgerdb::BufStats::BufStats</a></div><div class="ttdeci">BufStats()</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8h_source.html#l00150">buffer.h:150</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html_a93148e1af99f06f4f264d948920b7c1c"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html#a93148e1af99f06f4f264d948920b7c1c">badgerdb::BufMgr::getBufStats</a></div><div class="ttdeci">BufStats &amp; getBufStats()</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8h_source.html#l00276">buffer.h:276</a></div></div>
<div class="ttc" id="astructbadgerdb_1_1_buf_stats_html"><div class="ttname"><a href="structbadgerdb_1_1_buf_stats.html">badgerdb::BufStats</a></div><div class="ttdoc">Class to maintain statistics of buffer usage.</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8h_source.html#l00122">buffer.h:122</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html_a598b3112b8193af603f5bc97c478a671"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html#a598b3112b8193af603f5bc97c478a671">badgerdb::BufMgr::printSelf</a></div><div class="ttdeci">void printSelf()</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8cpp_source.html#l00194">buffer.cpp:194</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html_a9f853f0f1d4628e7e14374d0c7c6a4f3"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html#a9f853f0f1d4628e7e14374d0c7c6a4f3">badgerdb::BufMgr::readPage</a></div><div class="ttdeci">void readPage(File *file, const PageId PageNo, Page *&amp;page)</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8cpp_source.html#l00109">buffer.cpp:109</a></div></div>
<div class="ttc" id="aclassbadgerdb_1_1_buf_mgr_html_a702a264ae946b334414e51700edd81a0"><div class="ttname"><a href="classbadgerdb_1_1_buf_mgr.html#a702a264ae946b334414e51700edd81a0">badgerdb::BufMgr::clearBufStats</a></div><div class="ttdeci">void clearBufStats()</div><div class="ttdef"><b>Definition:</b> <a href="buffer_8h_source.html#l00284">buffer.h:284</a></div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
